/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 */

export const freezeDeep = (object: any) => {
  Object.freeze(object);
  for (const val of Object.values(object)) {
    if (typeof val === 'object' && !Object.isFrozen(val)) {
      freezeDeep(val);
    }
  }
  return object;
};
